package com.renwen.sms.util;

import java.io.Serializable;

/**
 * 返回结果工具类
 */
public class Result implements Serializable {
    private static final long serialVersionUID = -4319415850055691953L;
    private Integer code; // 200, 404, 500
    private String msg; // 结果信息
    private transient Object data;//返回数据，transient不进行序列化

    public Result(String msg) {
        this(200, msg);
    }
    public Result(String msg, Object data) {
        this(200, msg);
        this.data = data;
    }

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    // alt + fn + Insert
    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
